/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef __LIB3D_MATERIAL_TEXTURERENDERTARGET_H__
#define __LIB3D_MATERIAL_TEXTURERENDERTARGET_H__

#include "Texture.h"
#include <Atom.h>
#include <lib3d/hard/Hardware.h>

namespace liba
{
namespace lib3d
{
namespace material
{

class TextureRenderTargetName : public xml::ObjectANSI
{
protected:
	virtual bool on_attribute( xml::Provider * prov, const std::string & name, const std::string & value );
public:
	TextureRenderTargetName()
	:	wrap( true )
	{}
	bool operator<( const TextureRenderTargetName & na )const;

	Atom render_target_name;
	bool wrap;
};

class TextureRenderTarget : public Texture
{
	Atom render_target_name;
public:
	typedef TextureRenderTargetName Name;
	TextureRenderTarget(const Atom & animate_node_name, const TextureRenderTargetName & name)
	:	Texture(animate_node_name, name.wrap),
		render_target_name( name.render_target_name )
	{}
	virtual TextureRenderTarget * clone()const;
	virtual void render_to_list( hard::Hardware * hardware, hard::RenderTexture * render_texture );
};


} // namespace material
} // namespace lib3d
} // namespace liba
using namespace liba;

#endif //__LIB3D_MATERIAL_TEXTURERENDERTARGET_H__

